package com.roc.web.action.bankcard;

import java.util.ArrayList;
import java.util.List;

import com.roc.page.BaseSearchCondition;
import com.roc.page.WhereHQLFieldBean;
import com.roc.util.Constance;

public class BankCardQuerySearchCondition extends BaseSearchCondition{
	
	private String bankName;
	private String bankName1;

	@Override
	protected List<WhereHQLFieldBean> getWhereHQLFieldBeanList() {
		List<WhereHQLFieldBean> filedBeanList = new ArrayList<WhereHQLFieldBean>();
		
		if(Constance.isNotEmpty(bankName)){ 
			filedBeanList.add(new WhereHQLFieldBean("c.code", bankName.trim(), "like", false,"FIRST"));
		}
		if(Constance.isNotEmpty(bankName1)){ 
			if(Constance.isNotEmpty(bankName)){ 
				filedBeanList.add(new WhereHQLFieldBean("c.code", bankName.trim(), "like", false,"FIRST"));
			}
			filedBeanList.add(new WhereHQLFieldBean("c.name", bankName1.trim(), "like", false,"ALL"));
		}
		return filedBeanList;
	}

	@Override
	protected String getRowCountHQL() {
		return "select count(*) from TblUnionpayBanklist c where 1=1 ";
	}

	@Override
	protected String getSearchHQL() {
		// TODO Auto-generated method stub
		return "from TblUnionpayBanklist c where 1=1 ";
	}

	@Override
	protected String getOrderPartOfHQL() {
		// TODO Auto-generated method stub
		return "order by c.code desc";
	}

	public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	public String getBankName1() {
		return bankName1;
	}

	public void setBankName1(String bankName1) {
		this.bankName1 = bankName1;
	}

}
